from django.contrib import admin

from .models import Listing
# Register your models here.

class ListingAdmin(admin.ModelAdmin):
    list_display = ('id', 'title', 'is_published', 'price', 'list_date', 'realtor')
    list_display_links = ('id', 'realtor')
    list_filter = ('realtor',) #定义显示筛选的区域
    list_editable = ('is_published',) #定义可编辑
    search_fields = ('title','city', 'zipcode') #定义可搜索
    list_per_page = 25 #定义每页显示条数 

admin.site.register(Listing, ListingAdmin)